package com.tyk.bookstore.front.order.repository;


import com.tyk.bookstore.front.common.dal.mapper.IMapper;
import com.tyk.bookstore.front.order.dto.OrderDetail4StockDto;
import com.tyk.bookstore.front.order.model.dto.Order4CommentDto;
import com.tyk.bookstore.front.order.model.dto.OrderDetailDto;
import com.tyk.bookstore.front.order.model.entity.OrderDetailDo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author tyk
 * @description 订单明细管理
 */
@Mapper
public interface OrderDetailRepository extends IMapper<OrderDetailDo> {

    /**
     * 查询订单明细
     */
    List<OrderDetailDo> selectListByOrderId(@Param("orderId") Long orderId);

    /**
     * 查询订单明细
     */
    List<OrderDetailDto> selectOrderDetailDtoByOrderIdSet(@Param("orderIdSet") Set<Long> orderIdSet, @Param("memberId") Long memberId);

    /**
     * 查询订单明细
     */
    List<OrderDetail4StockDto> selectOrderDetail4StockDtoListByOrderId(@Param("orderId") Long orderId);

    /**
     * 查询订单明细
     */
    Order4CommentDto selectOrder4CommentDtoById(@Param("id") Long id, @Param("memberId") Long memberId);


    /**
     * 查询可评论的商品
     */
    Set<Long> selectCommentAbleOrderIdByOrderIdSet(@Param("orderIdSet") Set<Long> orderIdSet, @Param("memberId") Long memberId);
}
